package com.lufei4.chestnut.orbyun.Broad;

import java.util.Observable;

/**
 * @ProjectName: Chestnut
 * @Package: com.lufei4.chestnut.orbyun.Broad
 * @ClassName: ObservableObject
 * @Description: java类作用描述
 * @Author: liushijiang 15833013864@163.com
 * @CreateDate: 2020/9/25 18:12
 * @UpdateUser: 更新者：
 * @UpdateDate: 2020/9/25 18:12
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */

public class ObservableObject extends Observable {
    private static ObservableObject instance = new ObservableObject();
    public static ObservableObject getInstance() {
        return instance;
    }

    private ObservableObject() {
    }

    public void updateValue(Object data) {
        synchronized (this) {
            setChanged();
            notifyObservers(data);
        }
    }
}
